import { createSSRApp } from 'vue'
// 导入 Pinia
import { createPinia } from 'pinia'
// Pinia 持久化插件
// @ts-ignore
import { createUnistorage } from 'pinia-plugin-unistorage'
// import { createUnstoragePlugin } from 'unstorage-pinia-plugin'

import App from './App.vue'
// import '@/utils/utils'

export function createApp() {
  const app = createSSRApp(App)
  // 创建 Pinia 实例
  const pinia = createPinia()
  // pinia.use(
  //   createUnstoragePlugin({
  //     // unstorage plugin options
  //   })
  // )
  // 应用 Pinia 插件
  pinia.use(createUnistorage())
  // pinia.use(createUnstoragePlugin())

  app.use(pinia)

  return {
    app,
  }
}
